export const useTheme = () => {
  // 切换暗黑模式
  const switchDark = () => {
    const html = document.documentElement;
    console.log(document.documentElement.className);
    if (html.className === "dark") {
      html.setAttribute("class", "");
    } else {
      html.setAttribute("class", "dark");
    }
  };

  // 初始化主题
  const initTheme = () => {
    switchDark();
  };

  return {
    initTheme,
    switchDark,
  };
};
